# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=cargo-leptos
pkgver=0.2.21
pkgrel=0
pkgdesc="Build tool for Leptos"
url="https://leptos.dev"
arch="x86_64 aarch64" # dart-sass
license="MIT"
makedepends="cargo-auditable"
depends="
	binaryen
	cargo
	cargo-generate
	dart-sass
"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/leptos-rs/cargo-leptos/archive/refs/tags/v$pkgver.tar.gz
"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen --features no_downloads
}

check() {
	cargo test --frozen --features no_downloads
}

package() {
	install -Dm 755 target/release/cargo-leptos "$pkgdir"/usr/bin/cargo-leptos

	install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

sha512sums="
6e8c9d0c1b2be98fa5f1f2e41152c7a66ae92c04b294ac165ef034cc596de81b9976740962eda872c2ce96073fdf64ea64dc18045ad1ca86dd34df535236a07a  cargo-leptos-0.2.21.tar.gz
"
